<?php

/*

Check Names (checknames.php)

*/

$rank_check = 0;
$page_title = "Check Names";
include "header.inc.php";

ECHO <<<END

<HTML>
<HEAD>
<TITLE>$gameName2: $page_title</TITLE>
<script language="JavaScript">

function closeWindow(url)
{
   	window.close();
}

</script>

	<style><!--
	A:link {
	text-decoration:  underline;
	color: $mainlinkColor;
	}
	A:visited {
	text-decoration:  underline;
	color: $mainlinkColor;
	}
	A:hover {
	text-decoration:  underline;
	color: $mainlinkColor;
	}
	A:active {
	text-decoration:  underline;
	color: $mainlinkColor;
	}
	--></style>

</HEAD>
<BODY BGCOLOR="$reallyLight">

END;

if ($page == "check")
{
	$check = fetch("SELECT username FROM members2 WHERE username = '$check_name' AND game = '$game'");

	print "<p align=center>The name <b>$check_name</b><Br>";

	if (!$check[username])
	{
		print "<font color=green><b>is available!</b></font></p>";
	}

	if ($check[username])
	{
		print "<font color=red>is <b>not</b> available!</font></p>";
	}
	$page = "";
}

if ($page != "check")
{
	print "
	<form action=check_names.php?game=$game&page=check method=post>
	<p align=center>Check Name:<br>
	<input type=text name=check_name><Br>
	<input type=submit name=submit value=\"Check Availability\">
	</form>
	<p></p>
	";
}

print "<p align=center><input type=button name=closeWin value=\"Close Window\" onClick=\"javascript:closeWindow('');\"></p>";

?>